#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>

char buf1[] = "abcdefghij";
char buf2[] = "ABCDEFGHIJ";

int main() {
	int fd;

	if ((fd=creat("file.hole", S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) {
		printf("create error: %s\n", strerror(errno));
		return -1;
	}

	if (write(fd, buf1, 10) != 10) {
		printf("buf1 write error: %s\n", strerror(errno));
		return -1;
	}

	if (lseek(fd, 2048, SEEK_CUR) == -1) {
		printf("write error: %s\n", strerror(errno));
		return -1;
	}

	if (write(fd, buf2, 10) != 10) {
		printf("buf2 write error: %s\n", strerror(errno));
		return -1;
	}

	return 0;
}
